<?php
/* @var $this HistJurnalController */
/* @var $model HistJurnal */


$this->breadcrumbs=array(
	'Hist Jurnals'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List HistJurnal', 'url'=>array('index')),
	array('label'=>'Create HistJurnal', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#hist-jurnal-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manajemen Jurnal</h1>

<a href="<?php echo Yii::app()->createUrl('histJurnal/create'); ?>" class="btn btn-sm btn-primary">Add New</a><br /><br />


<?php //echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView',array(
	'itemsCssClass'=>'table table-hover table-striped table-bordered table-condensed',
	'id'=>'hist-jurnal-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'id',
		//'mst_account_id',
		'jurnal_no',
		//'description',
		'trx_date',
		//'debet',
		/*
		'credit',
		'createdby',
		'createdtime',
		'updatedby',
		'updatedtime',
		
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
		),*/
		array(
                'class'=>'bootstrap.widgets.TBButtonColumn',
               'template' => ' {view} {print}',
               'buttons' => array(
							 'view' => array(
                              'url' => 'Yii::app()->createUrl("histJurnal/edit", array("nomor"=>$data->jurnal_no))',
                              'options'=>array(
                                   'class'=>'btn btn-small print',
                                   ),
                            ),
                            'print' => array(
                              'url' => 'Yii::app()->createUrl("histJurnal/cetak", array("nomor"=>$data->jurnal_no))',
                              'options'=>array(
                                   'class'=>'btn btn-small print',
								   'target'=>'_blank'
                                   ),
                            ),

               ),
            'htmlOptions'=>array('style'=>'width: 250px'),
           ),
	),
)); ?>